<template>
	<view class="content">
		<view class="flex-1 flexc align-center justify-center">
			<image class="code" src="@/static/applogo.png"></image>
			<view class="text-color2">
				截图进行保存图片或点击<br>
				下方按钮分享给好友
			</view>
		</view>
		<button class="primary-button" open-type="share">
			赠送优惠券
		</button>
	</view>
</template>

<script setup>
// function showShareMenu() {
// 	console.log('showShareMenu')
// 	wx.showShareMenu({
// 	  withShareTicket: true,
// 	  menus: ['shareAppMessage', 'shareTimeline']
// 	})
// }
import { onShareAppMessage } from '@dcloudio/uni-app'
onShareAppMessage((options) => {
	console.log('onShareAppMessage', options)
	if (options.from == 'button') {
		return {
			title: '分享好友',
			path: '/pages/appointment/appointment?inviteCode=123'
		}
	} else {
		//
	}
})
</script>

<style lang="scss">
.content {
	background-color: white;
	padding: 48rpx;
	border-top: 1px solid $divider-color;
	.code {
		width: 512rpx;
		height: 512rpx;
		margin-bottom: 48rpx;
	}
	.text-color2 {
		// width: 300rpx;
		text-align: center;
		line-height: 50rpx;
	}
	.primary-button {
		align-self: stretch;
		width: 100%;
	}
}
</style>
